﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MINERP.BLL.Common;

namespace MINERP.ComControls.CommonUserControl
{
    public partial class UCMonitorBoardStatus : UserControl
    {
        public UCMonitorBoardStatus()
        {
            InitializeComponent();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            this.Controls.Clear();

            //从数据库中获取目前的大板状态的数量
            int lblIndex = 0, lblWidth = 25;
            Point lblLocation = new Point(5, 5);
            var listMsg = BoardStatsMonitorBLL.GetAllBoardStausAndQutiy();
            foreach (var msg in listMsg)
            {
                Label lbl = new Label();
                lbl.Name = "lbl" + lblIndex;
                lbl.Text = msg;
                if (lblIndex != 0)
                {
                    lblLocation = new Point(5, lblLocation.Y + lblWidth + 5);
                }
                lblIndex++;
                lbl.Location = lblLocation;
                this.Controls.Add(lbl);
            }

        }
    }
}
